define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'wx.wx_fans/index',
        add_url: 'wx.wx_fans/add',
        edit_url: 'wx.wx_fans/edit',
        delete_url: 'wx.wx_fans/delete',
        export_url: 'wx.wx_fans/export',
        modify_url: 'wx.wx_fans/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},                    {field: 'id', title: '粉丝ID'},                    {field: 'nickname', title: '昵称'},                    {field: 'headimgurl', title: '头像'},                    {field: 'sex', title: '性别'},                    {field: 'language', title: '用户语言'},                    {field: 'country', title: '国家'},                    {field: 'province', title: '省'},                    {field: 'city', title: '城市'},                    {field: 'openid', title: '用户的标识，对当前公众号唯一     用户的唯一身份ID'},                    {field: 'groupid', title: '粉丝所在组id'},                    {field: 'subscribe', title: '是否订阅'},                    {field: 'subscribe_scene', title: '订阅场景'},                    {field: 'remark', title: '备注', templet: ea.table.text},                    {field: 'tag', title: '标签'},                    {field: 'tagid_list', title: '标签列表'},                    {field: 'subscribe_time', title: '订阅时间'},                    {field: 'unsubscribe_time', title: '解订阅时间'},                    {field: 'qr_scene', title: '二维码扫码场景（开发者自定义）'},                    {field: 'qr_scene_str', title: '二维码扫码场景描述（开发者自定义）'},                    {field: 'status', title: 'status', templet: ea.table.switch},                    {field: 'create_time', title: 'create_time'},                    {width: 250, title: '操作', templet: ea.table.tool},
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});